import base
from imgaug import augmenters as iaa
import random
import os
import config
import re

for p_dir,dirs,files in os.walk(config.annotation_dir):
    if p_dir == config.annotation_dir:
        for name in files:
            id = os.path.splitext(name)[0]
            xml_path = base.get_annotation_path(id)
            content = base.read_file_content(xml_path)
            content = re.sub("<filename>\d+\.jpg</filename>","<filename>"+id+".jpg</filename>",content)
            # base.write_file_content(content,xml_path)

